﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="MenuButtonStyle.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
	<LinearGradientBrush x:Key="ControlItem_Background_Normal" EndPoint="0.5,1" StartPoint="0.5,0">
		<GradientStop Color="White"/>
		<GradientStop Color="Gainsboro" Offset="0.43"/>
		<GradientStop Color="#FFADADAD" Offset="0.44"/>
		<GradientStop Color="#FFD4D4D4" Offset="1"/>
	</LinearGradientBrush>
	<!-- Resource dictionary entries should be defined here. -->
	<SolidColorBrush x:Key="ControlItem_OuterBorder_Normal" Color="#FF848484"/>
	<SolidColorBrush x:Key="ControlItem_InnerBorder_Normal" Color="#FFFFFFFF"/>
	<SolidColorBrush x:Key="ControlItem_OuterBorder_MouseOver" Color="#FFFFC92B"/>
	<SolidColorBrush x:Key="ControlItem_InnerBorder_MouseOver" Color="#FFFFFFFF"/>
	<LinearGradientBrush x:Key="ControlItem_Background_MouseOver" EndPoint="0.5,1" StartPoint="0.5,0">
		<GradientStop Color="#FFFFFBA3" Offset="1"/>
		<GradientStop Color="#FFFFFBDA" Offset="0"/>
		<GradientStop Color="#FFFFD25A" Offset="0.43"/>
		<GradientStop Color="#FFFEEBAE" Offset="0.42"/>
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="ControlItem_OuterBorder_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
		<GradientStop Color="#FF282828"/>
		<GradientStop Color="#FF5F5F5F" Offset="1"/>
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="ControlItem_InnerBorder_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
		<GradientStop Color="#FFB69A78"/>
		<GradientStop Color="#FFFFE17A" Offset="0.126"/>
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="ControlItem_Background_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
		<GradientStop Color="#FFFFD74E" Offset="0.996"/>
		<GradientStop Color="#FFFFDCAB" Offset="0.17"/>
		<GradientStop Color="#FFFFB062" Offset="0.57"/>
		<GradientStop Color="#FFFFD18F" Offset="0.56"/>
		<GradientStop Color="#FFFFBA74"/>
	</LinearGradientBrush>
	<SolidColorBrush x:Key="ControlElement_Normal" Color="#FF000000"/>
	<SolidColorBrush x:Key="FocusBrushBlack" Color="#FF000000"/>
	<ControlTemplate x:Key="PanelBarItemTopLevelTemplate" TargetType="telerik:RadPanelBarItem">
		<Grid x:Name="RootElement">
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>
			<VisualStateManager.VisualStateGroups>
				<VisualStateGroup x:Name="CommonStates">
					<VisualState x:Name="Normal"/>
					<VisualState x:Name="Disabled">
						<Storyboard>
							<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="NormalVisual"/>
							<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisual"/>
							<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="arrow"/>
							<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Header"/>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="MouseOver">
						<Storyboard>
							<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual"/>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="MouseOut"/>
				</VisualStateGroup>
				<VisualStateGroup x:Name="SelectionStates">
					<VisualState x:Name="Unselected"/>
					<VisualState x:Name="Selected">
						<Storyboard>
							<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectVisual"/>
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
				<VisualStateGroup x:Name="ExpandStates">
					<VisualState x:Name="Expanded">
						<Storyboard>
							<DoubleAnimation Duration="0" To="180" Storyboard.TargetProperty="Angle" Storyboard.TargetName="directionRotation"/>
							<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ItemsContainer">
								<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
							</ObjectAnimationUsingKeyFrames>
							<DoubleAnimation Duration="0:0:0.2" From="0.0" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ItemsContainer"/>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="Collapsed"/>
				</VisualStateGroup>
				<VisualStateGroup x:Name="FocusStates">
					<VisualState x:Name="Focused">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusVisual">
								<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="Unfocused">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusVisual">
								<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
			</VisualStateManager.VisualStateGroups>
			<Grid x:Name="HeaderRow">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="Auto"/>
				</Grid.ColumnDefinitions>
				<Border x:Name="NormalVisual" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="5">
					<Border BorderBrush="{StaticResource ControlItem_InnerBorder_Normal}" BorderThickness="1" Background="{TemplateBinding Background}"/>
				</Border>
				<Border x:Name="MouseOverVisual" BorderBrush="{StaticResource ControlItem_OuterBorder_MouseOver}" BorderThickness="1" Grid.ColumnSpan="5" Opacity="0">
					<Border BorderBrush="{StaticResource ControlItem_InnerBorder_MouseOver}" BorderThickness="1" Background="{StaticResource ControlItem_Background_MouseOver}"/>
				</Border>
				<Border x:Name="SelectVisual" BorderBrush="{StaticResource ControlItem_OuterBorder_Selected}" BorderThickness="1" Grid.ColumnSpan="5" Opacity="0">
					<Border BorderBrush="{StaticResource ControlItem_InnerBorder_Selected}" BorderThickness="1" Background="{StaticResource ControlItem_Background_Selected}"/>
				</Border>
				<Border x:Name="DisabledVisual" BorderBrush="{StaticResource ControlOuterBorder_Disabled}" BorderThickness="1" Grid.ColumnSpan="5" Opacity="0">
					<Border BorderBrush="{StaticResource ControlInnerBorder_Disabled}" BorderThickness="1" Background="{StaticResource ControlBackground_Disabled}"/>
				</Border>
				<Path x:Name="arrow" Grid.Column="5" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Right" Margin="7 0" Opacity="1" RenderTransformOrigin="0.5 0.5" Stretch="None" Stroke="{StaticResource ControlElement_Normal}" StrokeThickness="2" VerticalAlignment="Center">
					<Path.RenderTransform>
						<RotateTransform x:Name="directionRotation" Angle="0"/>
					</Path.RenderTransform>
				</Path>
				<ContentPresenter x:Name="Header" Grid.ColumnSpan="4" ContentTemplate="{TemplateBinding HeaderTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
				<Rectangle x:Name="FocusVisual" Grid.ColumnSpan="5" Grid.Column="0" IsHitTestVisible="False" Stroke="{StaticResource FocusBrushBlack}" StrokeThickness="1" StrokeDashArray="1 2" Visibility="Collapsed"/>
			</Grid>
			<Grid x:Name="ItemsContainer" Grid.Row="1" Visibility="Collapsed">
				<telerik:LayoutTransformControl x:Name="transformationRoot">
					<ItemsPresenter/>
				</telerik:LayoutTransformControl>
			</Grid>
		</Grid>
	</ControlTemplate>
	<SolidColorBrush x:Key="ControlSubItem_OuterBorder_MouseOver" Color="Transparent"/>
	<Thickness x:Key="ControlSubItem_OuterBorderThickness">0</Thickness>
    <SolidColorBrush x:Key="ControlSubItem_InnerBorder_MouseOver" Color="Transparent"/>
	<Thickness x:Key="ControlSubItem_InnerBorderThickness">0</Thickness>
	<LinearGradientBrush x:Key="ControlSubItem_Background_MouseOver" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="Transparent" Offset="1"/>
        <GradientStop Color="Transparent" Offset="0"/>
	</LinearGradientBrush>
	<CornerRadius x:Key="ControlSubItem_InnerCornerRadius">0</CornerRadius>
	<CornerRadius x:Key="ControlSubItem_OuterCornerRadius">0</CornerRadius>
    <SolidColorBrush x:Key="ControlSubItem_OuterBorder_Selected" Color="Transparent"/>
    <SolidColorBrush x:Key="ControlSubItem_InnerBorder_Selected" Color="Transparent"/>
	<LinearGradientBrush x:Key="ControlSubItem_Background_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="Transparent" Offset="1"/>
        <GradientStop Color="Transparent"/>
	</LinearGradientBrush>
	<ControlTemplate x:Key="PanelBarItemSecondLevelTemplate" TargetType="telerik:RadPanelBarItem">
		<Grid x:Name="RootElement">
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>
			<VisualStateManager.VisualStateGroups>
				<VisualStateGroup x:Name="CommonStates">
					<VisualState x:Name="Normal"/>
					<VisualState x:Name="Disabled">
						<Storyboard>
							<DoubleAnimation Duration="0" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisual"/>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="MouseOver">
						<Storyboard>
							<DoubleAnimation Duration="0:0:0.2" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual"/>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="MouseOut">
						<Storyboard>
							<DoubleAnimation Duration="0:0:0.2" To="0.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual"/>
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
				<VisualStateGroup x:Name="SelectionStates">
					<VisualState x:Name="Unselected"/>
					<VisualState x:Name="Selected">
						<Storyboard>
							<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectionVisual"/>
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
				<VisualStateGroup x:Name="ExpandStates">
					<VisualState x:Name="Expanded">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ItemsContainer">
								<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
							</ObjectAnimationUsingKeyFrames>
							<DoubleAnimation Duration="0:0:0.2" From="0.0" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ItemsContainer"/>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="Collapsed"/>
				</VisualStateGroup>
				<VisualStateGroup x:Name="FocusStates">
					<VisualState x:Name="Focused">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusVisual">
								<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="Unfocused">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusVisual">
								<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
			</VisualStateManager.VisualStateGroups>
			<Grid x:Name="HeaderRow" Background="Transparent">
				<Border x:Name="MouseOverVisual" BorderBrush="{StaticResource ControlSubItem_OuterBorder_MouseOver}" BorderThickness="{StaticResource ControlSubItem_OuterBorderThickness}" CornerRadius="{StaticResource ControlSubItem_OuterCornerRadius}" Opacity="0">
					<Border BorderBrush="{StaticResource ControlSubItem_InnerBorder_MouseOver}" BorderThickness="{StaticResource ControlSubItem_InnerBorderThickness}" Background="{StaticResource ControlSubItem_Background_MouseOver}" CornerRadius="{StaticResource ControlSubItem_InnerCornerRadius}"/>
				</Border>
				<Border x:Name="SelectionVisual" BorderBrush="{StaticResource ControlSubItem_OuterBorder_Selected}" BorderThickness="{StaticResource ControlSubItem_OuterBorderThickness}" CornerRadius="{StaticResource ControlSubItem_OuterCornerRadius}" Opacity="0">
					<Border BorderBrush="{StaticResource ControlSubItem_InnerBorder_Selected}" BorderThickness="{StaticResource ControlSubItem_InnerBorderThickness}" Background="{StaticResource ControlSubItem_Background_Selected}" CornerRadius="{StaticResource ControlSubItem_InnerCornerRadius}"/>
				</Border>
				<Border x:Name="DisabledVisual" BorderBrush="{StaticResource ControlOuterBorder_Disabled}" BorderThickness="{StaticResource ControlSubItem_OuterBorderThickness}" CornerRadius="{StaticResource ControlSubItem_OuterCornerRadius}" Opacity="0">
					<Border BorderBrush="{StaticResource ControlInnerBorder_Disabled}" BorderThickness="{StaticResource ControlSubItem_InnerBorderThickness}" Background="{StaticResource ControlBackground_Disabled}" CornerRadius="{StaticResource ControlSubItem_InnerCornerRadius}"/>
				</Border>
				<ContentPresenter x:Name="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
				<Rectangle x:Name="FocusVisual" IsHitTestVisible="False" RadiusY="2" RadiusX="2" Stroke="{StaticResource FocusBrushBlack}" StrokeThickness="1" StrokeDashArray="1 2" Visibility="Collapsed"/>
			</Grid>
			<Grid x:Name="ItemsContainer" Grid.Row="1" Visibility="Collapsed">
				<ItemsPresenter/>
			</Grid>
		</Grid>
	</ControlTemplate>
	<Style x:Key="RadPanelBarItemStyle" TargetType="telerik:RadPanelBarItem">
		<Setter Property="Background" Value="{StaticResource ControlItem_Background_Normal}"/>
		<Setter Property="BorderBrush" Value="{StaticResource ControlItem_OuterBorder_Normal}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Foreground" Value="{StaticResource ControlForeground_Normal}"/>
		<Setter Property="TabNavigation" Value="Once"/>
		<Setter Property="IsTabStop" Value="True"/>
		<Setter Property="Template" Value="{StaticResource PanelBarItemTopLevelTemplate}"/>
		<Setter Property="Padding" Value="3"/>
		<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
		<Setter Property="VerticalContentAlignment" Value="Stretch"/>
		<Setter Property="ChildItemsTemplate" Value="{StaticResource PanelBarItemSecondLevelTemplate}"/>
		<Setter Property="ItemsPanel">
			<Setter.Value>
				<ItemsPanelTemplate>
					<StackPanel Background="Transparent"/>
				</ItemsPanelTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>